package cn.edu.lzzy.vm;

public class JSONResult {
    private Integer code;//状态码
    private Object data;//数据
    private String message;//信息

    private JSONResult() {
        super();
    }
    public JSONResult(Object data,String msg) {
        super();
        this.data=data;
        this.message=msg;
    }

    public JSONResult(Integer code, Object data, String msg) {
        super();
        this.code=code;
        this.data=data;
        this.message=msg;
    }
    /**
     * 返回200,成功
     */
    public static JSONResult isOk(Object data,String msg){
        return new JSONResult(200, data,msg);
    }
    public static JSONResult isError(Integer code,String msg){
        return new JSONResult(code,null,msg);
    }

//    public static JSONResult isOk(int i, VmApplicant vmApplicant, String toString) {
//    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
